package com.xyy.saas.payment.service.impl;

import com.xyy.saas.payment.dao.mapper.SubBankCodeMapper;
import com.xyy.saas.payment.dao.model.SubBankCode;
import com.xyy.saas.payment.service.SubBankCodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SubBankCodeServiceImpl implements SubBankCodeService {

    @Autowired
    private SubBankCodeMapper subBankCodeMapper;

    @Override
    public List<SubBankCode> likeByName(String bankName, String subBankName, Integer offset, Integer limit) {
        return subBankCodeMapper.likeByName(bankName, subBankName,offset, limit);
    }

    @Override
    public int batchInsert(List<SubBankCode> entities) {
        if(entities.size() > 1000) {
            throw new RuntimeException("最大批量插入1000条!");
        }
        return subBankCodeMapper.batchInsert(entities);
    }

    @Override
    public SubBankCode queryByCode(String code) {
        return subBankCodeMapper.queryByCode(code);
    }
}
